package com.dadi.vine.user.service.impl;

import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dadi.vine.user.mapper.SysUserMapper;
import com.dadi.vine.user.service.SysService;
import com.google.gson.Gson;

/**
 * 类说明
 *
 * @Author ChenYL
 * @Email chenyl@dadi18.com
 * @Date 2017年10月31日 下午4:39:46
 */
@Service
public class SysServiceImpl implements SysService {

	@Autowired
	SysUserMapper userMapper;

	@Override
	public Map<String, Object> getUserByUserId(String userId) throws Exception {
		System.out.println("进入SysService");
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("code", "0000");
		map.put("message", "交易成功");
		map.put("result", userMapper.selectByPrimaryKey(userId));
		return map;
	}

	@Override
	public Map<String, Object> getUser() throws Exception {
		System.out.println("进入SysService");
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", "13971115867");
		map.put("name", "陈月朗");
		map.put("age", "28");
		map.put("sex", "男");
		System.out.println(new Gson().toJson(map));
		return map;
	}
}